package com.neuedu.demo3;

public class Homework10 {
    public static void main(String[] args) {

        //for循环方法
        int sum1 = 0;

        for (int i = 0; i < 100; i++) {
            if (i % 3 == 0) {

                sum1 = sum1 + i;
            }
        }

        System.out.println(sum1);
        //while循环方法
        int j = 0;
        int sum2 = 0;

        while (j < 100) {
            if (j % 3 == 0) {
                sum2 = sum2 + j;
            }
            j++;
        }
        System.out.println(sum2);
        //do  while 循环方法
        int k = 0;
        int sum3 = 0;
        do {

            if (k % 3 == 0) {
                sum3 = sum3 + k;

            }
            k++;
        } while (k < 100);
        System.out.println(sum3);
    }
}
